package com.molichuxing.gateway.bff.order.entity.response;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.molichuxing.framework.dto.ResponseRootDto;
import com.molichuxing.services.property.OrderScheduleStatusEnum;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 订单还款计划vo
 * 
 * @author zoumingyu
 * @date 2019年8月23日
 *
 */
@Data
public class OrderRepaymentVo extends ResponseRootDto {
	private static final long serialVersionUID = 251365339418987862L;

	@ApiModelProperty(value = "订单号")
	private Long orderCode;
	
	@ApiModelProperty(value = "用户id")
	private Integer userId;

	@ApiModelProperty(value = "用户姓名")
	private String userRealName;

	@ApiModelProperty(value = "用户手机")
	private String userPhone;

	@ApiModelProperty(value = "还款期数")
	private Integer periods;

	@ApiModelProperty(value = "总期数")
	private Integer totalPeriods;

	@ApiModelProperty(value = "金额")
	private BigDecimal payable;

	@ApiModelProperty(value = "已还金额")
	private BigDecimal hasPayAmount;

	@ApiModelProperty(value = "总金额")
	private BigDecimal totalAmount;

	@ApiModelProperty(value = "应还款日")
	private LocalDate payableDate;

	@ApiModelProperty(value = "还款状态（0：未还款，1：已还款，2：已终止）")
	private Integer status;
	
	@ApiModelProperty(value = "还款状态str")
	private String statusStr;

	@ApiModelProperty(value = "还款时间")
	private LocalDateTime paySuccessTime;

	public void setStatus(OrderScheduleStatusEnum status) {
		this.status = status == null ? null : status.getValue();
		this.statusStr = status == null ? null : status.getName();
	}
}
